---
--类名: BattleConfirmController.lua
--创建日期: 2015-6-26
--创建人: 陈小虎
--功能描述: 战斗确认控制器
--修改内容：
--修改日期:   
--修改人:     
--修改备注: 
--

local BattleConfirmView = import("..views.BattleConfirmView")

local BattleConfirmController = class("BattleConfirmController",function()
    return display.newNode()
end)

function BattleConfirmController:ctor(isEscort)

	-- self:addTouchMask()

	self.mBattleConfirmView = BattleConfirmView.new(self,isEscort)
	self:addChild(self.mBattleConfirmView)
end

-- function BattleConfirmController:addTouchMask()
--     self.mTouchMaskListener = cc.EventListenerTouchOneByOne:create()
--     self.mTouchMaskListener:setSwallowTouches(true)
--     self.mTouchMaskListener:registerScriptHandler(function(touch, event)
--         return true
--     end, cc.Handler.EVENT_TOUCH_BEGAN)

--     self.mTouchMaskListener:registerScriptHandler(function(touch, event)
--         end, cc.Handler.EVENT_TOUCH_ENDED)
--     self:getEventDispatcher():addEventListenerWithSceneGraphPriority(self.mTouchMaskListener, self)
    
-- end

function BattleConfirmController:setOkCallback(okCall)
	self.mOkCallback = okCall
end

function BattleConfirmController:setCancelCallback(cancelCall)
	self.mCancelCallback = cancelCall
end

function BattleConfirmController:okCallback()
	if self.mOkCallback then
		self.mOkCallback()
	end
end

function BattleConfirmController:cancelCallback()
	if self.mCancelCallback then
		self.mCancelCallback()
	end
end

return BattleConfirmController